﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class admin_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Cells[12].Attributes.Add("onclick", "javascript:return confirm('您确定要删除该记录吗?\\n\\n您将无法恢复！')");
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        HtmlGenericControl _insert_new_data =(HtmlGenericControl)ListView1.FindControl("insert_new_data");
        _insert_new_data.Attributes["visible"] = "true";
        //UpdatePanel1.FindControl("insert_new_data")
    }
    protected void ListView1_ItemInserting(object sender, ListViewInsertEventArgs e)
    {
        //DropDownList _dropdownlist = (DropDownList)ListView1.FindControl("DropDownList2");
        //if (_dropdownlist.SelectedValue == "中国电信集团公司")
        //{
        //    e.Values["E_company"] = "CHINA TELECOM corporation"; 
        //}
        //else if (_dropdownlist.SelectedValue == "中国移动通信集团公司")
        //{
        //    e.Values["E_company"] = "China Mobile Communication Corporation(CMCC)";
        //}
        //else
        //{
        //    e.Values["E_company"] = "China United Telecommunications Co. Ltd"; 
        //}

    }
    protected void ListView1_ItemInserting1(object sender, ListViewInsertEventArgs e)
    {
        DropDownList _drop = (DropDownList)ListView1.InsertItem.FindControl("DropDownList2");
        //Response.Write(_drop.SelectedValue);
        e.Values["type"] = _drop.SelectedValue;
    }
}
